﻿using FireStarterModeller.BO;
using Habanero.Testability;

namespace FireStarterModeller.Test.BO
{
    public class TestUtilsUIGridInfo
    {

        public static BOTestFactory<UIGridInfo> GetFactory()
        {
            return BOTestFactoryRegistry.Instance.Resolve<UIGridInfo>();
        }
        /// <summary>
        /// Creates a new saved UIGridInfo with a random value assigned to every property
        /// </summary>
        public static UIGridInfo CreateSavedUIGridInfo()
        {
            UIGridInfo uIGridInfo = CreateUnsavedValidUIGridInfo();
            uIGridInfo.Save();
            return uIGridInfo;
        }

        /// <summary>
        /// Creates a new unsaved UIGridInfo with a random value assigned to every property
        /// </summary>
        public static UIGridInfo CreateUnsavedValidUIGridInfo()
        {
            UIGridInfo uIGridInfo = CreateUnsavedValidUIGridInfo_WNoUIView();
            uIGridInfo.UIViewID = TestUtilsUIView.CreateSavedUIView().UIViewID;
            return uIGridInfo;
        }
	    
        /// <summary>
        /// Creates a new unsaved UIGridInfo where all properties are null, except ID properties
        /// and those with default values.  If there are compulsory properties without
        /// defaults, saving the object will throw an exception.
        /// </summary>
        public static UIGridInfo CreateUnsavedDefaultUIGridInfo()
        {
            UIGridInfo uIGridInfo = new UIGridInfo();
            return uIGridInfo;
        }
        /// <summary>
        /// Creates a new unsaved UIGridInfo with a random value assigned to every property
        /// </summary>
        public static UIGridInfo CreateUnsavedValidUIGridInfo_WNoUIView()
        {
            UIGridInfo uIGridInfo = new UIGridInfo();
            uIGridInfo.SortColumn = TestUtilsShared.GetRandomString();
            uIGridInfo.Generated = TestUtilsShared.GetRandomBoolean();
            return uIGridInfo;            
        }
    }
}